package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-10-11
 * Time: 17:28
 */


@RestController
public class UserController {
    @RequestMapping("/sayhi")
    public String sayHi() {
        System.out.println("sayHi 方法：被执行了。");
        //int a = 10 / 0 ;  //这是演示After Throwing方法 没有执行return方法 返会的
        return "你好，世界。";
    }

    @RequestMapping("/sayhello")
    public String sayHello() throws InterruptedException {
        System.out.println("sayHello 方法：被执行了。");
        return "世界，你好。";
    }
}
